package com.bjbn.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bjbn.entity.BridgeInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 廊桥_登机桥信息_模型Mapper接口
 */
@Mapper
public interface BridgeInfoMapper extends BaseMapper<BridgeInfo> {
    
    /**
     * 统计总记录数
     */
    @Select("SELECT COUNT(*) FROM bridge_info")
    Long countTotal();
    
    /**
     * 根据设备名称查询
     */
    @Select("SELECT * FROM bridge_info WHERE DEVICE_NAME LIKE CONCAT('%', #{deviceName}, '%')")
    java.util.List<BridgeInfo> findByDeviceNameContaining(String deviceName);
    
    /**
     * 分页查询廊桥信息
     */
    @Select("SELECT * FROM bridge_info LIMIT #{offset}, #{limit}")
    java.util.List<BridgeInfo> selectPage(@Param("offset") int offset, @Param("limit") int limit);
    
    /**
     * 根据厂家查询
     */
    @Select("SELECT * FROM bridge_info WHERE BRAND = #{brand}")
    java.util.List<BridgeInfo> findByBrand(String brand);
    
    /**
     * 根据区域查询
     */
    @Select("SELECT * FROM bridge_info WHERE AREA = #{area}")
    java.util.List<BridgeInfo> findByArea(String area);
    
    /**
     * 根据设备组查询
     */
    @Select("SELECT * FROM bridge_info WHERE DEVICE_GROUP = #{deviceGroup}")
    java.util.List<BridgeInfo> findByDeviceGroup(String deviceGroup);
    
    /**
     * 根据设备状态查询
     */
    @Select("SELECT * FROM bridge_info WHERE STA = #{sta}")
    java.util.List<BridgeInfo> findBySta(String sta);
    
    /**
     * 根据IP地址查询
     */
    @Select("SELECT * FROM bridge_info WHERE IP = #{ip}")
    java.util.List<BridgeInfo> findByIp(String ip);
    
    /**
     * 根据责任部门查询
     */
    @Select("SELECT * FROM bridge_info WHERE DEPT = #{dept}")
    java.util.List<BridgeInfo> findByDept(String dept);
}
